package com.zhuiyun.project.api.onlineservice.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhuiyun.project.common.entity.BaseEntity;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 *
 * @ClassName OnlineserviceChat
 * @Description 客服聊天信息
 * @Author zsh
 * @Date 2024/3/13 14:00
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("onlineservice_chat")
public class OnlineserviceChat extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /** 客服与用户聊天表主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)//id主键递增
    private Integer id;

    /** 发送人的id */
    private Integer senderId;

    /** 接收信息人的id */
    private Integer receiverId;

    /** 发送人头像路径 */
    private String setAvatarUrl;

    /** 接收信息人的名称 */
    private String receiverName;

    /** 发送信息，文字，图片，视频，文件 */
    private String message;

    /**发送信息类型，text，image，video，file，"kefu"判断客服是否在线 */
    private String type;
    /**
     * 发送信息的时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss" )//DateTimeFormat 是入参格式化；
    private Date time;

    /**发送人的姓名 */
    private String username;



}
